package cn.service.impl;

import cn.dao.OrdersdetailDao;
import cn.entity.Ordersdetail;
import cn.service.OrdersdetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OrdersdetailServiceImpl implements OrdersdetailService{
	@Autowired
	OrdersdetailDao ordersdetailDao;
	@Override
	public int deleteByPrimaryKey(Object id) {
		return ordersdetailDao.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Ordersdetail record) {
		return ordersdetailDao.insert(record);
	}

	@Override
	public Ordersdetail selectByPrimaryKey(Object id) {
		return ordersdetailDao.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKey(Ordersdetail record) {
		return ordersdetailDao.updateByPrimaryKey(record);
	}

	@Override
	public List<Ordersdetail> find(Integer oid) {
		List<Ordersdetail> list=new ArrayList<Ordersdetail>();
		try{
			Map<String, Object> params=new HashMap<String, Object>();
			params.put("oid", oid);
			list=ordersdetailDao.find(params);
		}catch(Exception ex){
			ex.printStackTrace();
		}
		return list;
	}



	
	
}
